package com.baizhi.service.impl;

import com.baizhi.dao.AdminDao;
import com.baizhi.entity.Admin;
import com.baizhi.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;
    @Override
    @Transactional(readOnly = true)
    public boolean login(String username, String password) {
        Admin admin = adminDao.selectByUsername(username);
        if(admin!=null && admin.getPassword().equals(password)){
            return true;
        }
        return false;
    }
}
